import { EntitySchema } from '@mikro-orm/core';

export class TypechoShoptype {
  id!: number;
  parent?: number = 0;
  name?: string;
  pic?: string;
  intro?: string;
  orderKey?: number = 0;
}

export const TypechoShoptypeSchema = new EntitySchema({
  class: TypechoShoptype,
  properties: {
    id: { primary: true, type: 'number' },
    parent: { type: 'number', nullable: true, default: 0 },
    name: { type: 'string', length: 255, nullable: true },
    pic: { type: 'string', length: 400, nullable: true },
    intro: { type: 'string', length: 400, nullable: true },
    orderKey: { type: 'number', fieldName: 'orderKey', nullable: true, default: 0 },
  },
});
